import tkinter as tk
from tkinter import ttk

class PyWinDesign:
    def __init__(self, 启动窗口):
        self.启动窗口 = 启动窗口
        self.启动窗口.title("启动窗口")
        self.启动窗口.resizable(width=False, height=False)
        screenwidth = self.启动窗口.winfo_screenwidth()
        screenheight = self.启动窗口.winfo_screenheight()
        size = '%dx%d+%d+%d' % (263, 160, (screenwidth - 263) / 2, (screenheight - 160) / 2)
        self.启动窗口.geometry(size)
        
        self.标签1_标题 = tk.StringVar()
        self.标签1_标题.set('作品：')
        self.标签1 = tk.Label(self.启动窗口,textvariable=self.标签1_标题,anchor=tk.W)
        self.标签1.place(x=9,y=9,width=80,height=24)
        
        self.标签2_标题 = tk.StringVar()
        self.标签2_标题.set('作者：')
        self.标签2 = tk.Label(self.启动窗口,textvariable=self.标签2_标题,anchor=tk.W)
        self.标签2.place(x=10,y=51,width=80,height=24)
        
        self.编辑框1 = tk.Text(self.启动窗口,wrap=tk.NONE,font=("微软雅黑",9))
        self.编辑框1.insert(tk.END,'零基础入门学习Python')
        self.编辑框1.place(x=100,y=13,width=155,height=20)
        
        self.编辑框2 = tk.Text(self.启动窗口,wrap=tk.NONE,font=("微软雅黑",9))
        self.编辑框2.insert(tk.END,'小甲鱼')
        self.编辑框2.place(x=100,y=57,width=155,height=20)
        
        self.按钮1_标题 = tk.StringVar()
        self.按钮1_标题.set('获取信息')
        self.按钮1 = tk.Button(self.启动窗口,textvariable=self.按钮1_标题,
                                            bg="#0083EE",
                                            fg="white",
                                            activeforeground="white",
                                            activebackground="#0088FF",
                                            font=("微软雅黑",9),
                                            bd=0,
                                            command=self.按钮1_被鼠标左键单击)
        self.按钮1.place(x=19,y=103,width=80,height=32)
        
        self.按钮2_标题 = tk.StringVar()
        self.按钮2_标题.set('退出')
        self.按钮2 = tk.Button(self.启动窗口,textvariable=self.按钮2_标题,
                                            bg="#0083EE",
                                            fg="white",
                                            activeforeground="white",
                                            activebackground="#0088FF",
                                            font=("微软雅黑",9),
                                            bd=0,
                                            command=self.按钮2_被鼠标左键单击)
        self.按钮2.place(x=150,y=103,width=80,height=32)
        
    def 按钮1_被鼠标左键单击(self):
        print('被鼠标左键单击')
        print(self.标签1_标题.get() + self.编辑框1.get(0.0,tk.END))
        print(self.标签2_标题.get() + self.编辑框2.get(0.0,tk.END))
        self.编辑框1.delete(0.0,tk.END)
        self.编辑框2.delete(0.0,tk.END)

    def 按钮2_被鼠标左键单击(self):
        root.quit()
        
        
if __name__ == '__main__':
    root = tk.Tk()
    root.iconbitmap("Icon.ico")
    app = PyWinDesign(root)
    root.mainloop()